-
Notifications
You must be signed in to change notification settings - Fork 92
feat(coder/modules/claude-code): add support for aibridge #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
wip. |
| For AI Bridge configuration set `enable_coder_aibridge` to `true`. [AI Bridge](https://coder.com/docs/ai-coder/ai-bridge) is a Premium Coder feature that provides centralized LLM proxy management. | ||
|
|
||
| ```tf | ||
| resource "coder_ai_task" "task" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I don't think we should provide the default example to be through tasks.
Not all users want it for tasks only.
So my suggestion is to either have two examples
- With tasks
- Standalone where we just install and configure Claude CLI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, but looks good. Also, what do you think about moving the AI Bridge example a bit higher before Bedrock and Vertex AI examples?
# Conflicts: # registry/coder/modules/claude-code/README.md # registry/coder/modules/claude-code/main.test.ts
| # Add API key only if set | ||
| if [ -n "${CLAUDE_API_KEY:-}" ]; then | ||
| jq --arg apikey "${CLAUDE_API_KEY}" '.primaryApiKey = $apikey' "$claude_config" > "${claude_config}.tmp" && mv "${claude_config}.tmp" "$claude_config" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we get any benefit from adding the key to the file? Why not only rely on coder_env and set it as ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be best to do this as well. Since this is the best way to ensure its set for claude-code globally in the environment. I moved the model to a coder env in the previous update as well.
|
|
||
| validation { | ||
| condition = !(var.enable_aibridge && length(var.claude_api_key) > 0) | ||
| error_message = "claude_api_key cannot be provided when enable_aibridge is true. AI Bridge uses Coder's authentication." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| error_message = "claude_api_key cannot be provided when enable_aibridge is true. AI Bridge uses Coder's authentication." | |
| error_message = "claude_api_key cannot be provided when enable_aibridge is true. AI Bridge automatically authenticates the client using their Coder credentials." |
What do you think about something like this?
Same suggestion below.
|
@35C4n0r other than what atif mentioned this looks good to me! |
Description
Type of Change
Module Information
Path:
registry/coder/modules/claude-codeNew version:
v4.5.0Breaking change: [ ] Yes [ ] No
Testing & Validation
bun test)bun fmt)Related Issues
Closes: #649